<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1.0, user-scalable=no" />			
		<title>“组团啦”杯全国大学生英雄联盟比赛</title>
		<link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
		<link rel="stylesheet" href="__PUBLIC__/css/reset.css" />
		<link rel="stylesheet" href="__PUBLIC__/css/public.css" />
		<link rel="stylesheet" href="__PUBLIC__/css/ui-dialog.css" />
		<link href='http://api.youziku.com/webfont/CSS/5689df59f629d80a10ae5e70' rel='stylesheet' type='text/css' />
		<style type="text/css">
			html,body{height: 100%;}
			body:before {
			  content: ' ';
			  position: fixed;
			  z-index: -1;
			  top: 0;
			  right: 0;
			  bottom: 0;
			  left: 0;
			  background-image: url(__PUBLIC__/img/34/bg3.jpg);
			  background-size: 100% 100%;
			}
			/*body{background-image: url();background-size: 100% 100%;background-attachment: fixed;}*/
		</style>
	</head>
	<body>
		<h2><span class="t-bigger">“组团啦”杯</span><br />2016全国大学生英雄联盟比赛<br />战队信息</h2>
		<form action="" id="tt" method="post">
			<div class="wrapper">
				<div class="input3-wrapper">
					<p class="title-label"><span class="star"></span>组合（战队）名称</p>
					<div class="input-s3 team-name">{$corpsname}</div>
				</div>
				<div class="input3-wrapper">
					<p class="title-label"><span class="star"></span>负责人姓名</p>
					<input type="text" class="input-s3"  name="headername" id="headername" placeholder="必填" value="{$name.headername}"/>
				</div>
				<div class="input3-wrapper">
					<p class="title-label"><span class="star"></span>身份证号码</p>
					<input type="text" class="input-s3" name="idcard" id="idcard" placeholder="必填" value="{$name.idcard}"/>
				</div>
				<div class="input3-wrapper">
					<p class="title-label"><span class="star"></span>邮箱</p>
					<input type="text" class="input-s3" name="email" id="email" placeholder="必填" value="{$name.email}"/>
				</div>
				<div class="input3-wrapper">
					<p class="title-label"><span class="star"></span>移动电话</p>
					<input type="text" class="input-s3"name="telephone" id="telephone" placeholder="必填" value="{$name.telephone}"/>
				</div>
				<div class="input3-wrapper">
					<p class="title-label"><span class="star"></span>QQ号</p>
					<input type="text" class="input-s3" name="qqnumber" id="qqnumber" placeholder="必填" value="{$name.qqnumber}"/>
				</div>
				<div class="input3-wrapper">
					<p class="title-label"><span class="star"></span>学校</p>
					<input type="text" class="input-s3" name="school" id="school" placeholder="必填" value="{$name.school}"/>
				</div>
				<div class="input3-wrapper">
					<p class="title-label"><span class="star"></span>备注</p>
					<textarea  rows="4" cols="" class="input-s3 note" name="remarks" id="remarks">{$name.remarks}</textarea>
				</div>
				<div class="btn-numWrapper">
					<!--提交-->
					<span class="btn-num" id="btn-num" onclick="add()"></span>
					<span id="btn-num-text" ></span>
					<input type="hidden" name="corpsnumber" id="corpsnumber">
					<input type="hidden" value="{$name.id}" name="id">
					<input type="hidden" name="channel" value="{$_GET['channel']}">
				</div>
				<div class="note-textWrapper">
					<p>恭喜你完成了第一阶段的报名→登入官网：<br /><a href="www.zutuan.la" style="color:#d85257">www.zutuan.la</a>下载报名表（队员信息）完成后续报名→通过指定方式上传报名表。这样完成才算报名成功哦！</p>
					<p><span>PS.</span><b>请不要遗忘你的战队编号~（建议截图留存)</b>报名结果和分组安排将在2016年3月1日公告。届时请关注官网及微信图文消息~</p>
				</div>
				<div class="thumb-wrapper">
					<div class="left" id="thumb"><img src="__PUBLIC__/img/34/thumbs.png" alt=""/></div>
					<div>【扫描指纹】<br />测测你命中注定是哪路英雄?</div>
				</div>
			</div>
		</form>
		<div class="modal fade" id="agreement" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <h4 class="modal-title" id="myModalLabel">参赛协议</h4>
		      </div>
		      <div class="modal-body">
		      	<p>1.比赛期间，选手不得拒绝裁判人员以观察者身份进入游戏中对游戏进行监督、记录和转播；</p>
		      	<p>2.主办方享有比赛视频的合法使用权；</p>
		      	<p>3.主办方有权使用参赛者的肖像做与活动相关的宣传；</p>
		      	<p>4.参赛选手在比赛期间如与职业战队或其他平台签约主播、教练、职业选手等有义务告知我平台。</p>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" id="btn-agreement">我同意</button>
		      </div>
		    </div>
		  </div>
		</div>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		<script src="__PUBLIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__PUBLIC__/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__PUBLIC__/js/dialog-min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var is_report ="{$_SESSION['is_report']}";

			if(is_report!=''){
				$("#btn-num-text").html(is_report);
				$("#btn-num").hide();
			}
			$("#thumb").on("touchstart",function(){
				if(is_report==""){
					dialog({
						content: '老夫夜观天象：你还没有生成战队编号，请生成并牢记你的战队编号，再来找老夫吧~',
						okValue: '确认',
						ok: function () {

						},
					}).showModal();
				}
				else{
					window.location.href="{:U('Join_us')}";
				}

			})

			$('#btn-num').on("touchstart",function(){
				$(this).css("background-image","url(__PUBLIC__/img/34/btn-2.png)");
			});
//			$('#btn-num').on("touchend",function(){
//				$(this).css("background-image","url(__PUBLIC__/img/34/btn-1.png)");
//				setTimeout(function(){
//					$('#agreement').modal('show');
//				},300)
//			})

//			//点击关闭模态框
			$("#btn-agreement").on("touchend",function(){
				$('#agreement').modal('hide');
				location.reload();
			})
			function add() {
				var headername=$("#headername").val();
				var idcard=$("#idcard").val();
				var email=$("#email").val();
				var telephone=$("#telephone").val();
				var qqnumber=$("#qqnumber").val();
				var school=$("#school").val();
				var remarks=$("#remarks").val();
				var corpsnumber=$("#corpsnumber").val();
				if(headername.length < 1){
					dialog({
						content: '请输入负责人姓名',
						okValue: '确认',
						ok: function () {
						},
					}).showModal();

					return;
				}
				if(idcard.length<1 ||!idcard.match(/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/)){
					dialog({
						content: '请输入有效的身份证号码',
						okValue: '确认',
						ok: function () {
						},
					}).showModal();

					return;
				}
				if(email.length< 1 || !email.match( /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/)){
					dialog({
						content: '请输入正确的邮箱',
						okValue: '确认',
						ok: function () {
						},
					}).showModal();

					return;
				}
				if(telephone.length<1 || !telephone.match(/^[1][3456789][0-9]{9}$/)){
					dialog({
						content: '请输入有效的手机号码',
						okValue: '确认',
						ok: function () {
						},
					}).showModal();

					return;
				}
				if(qqnumber.length<1 || !qqnumber.match(/^[0-9]*$/)){
					dialog({
						content: '请输入有效的手机号',
						okValue: '确认',
						ok: function () {
						},
					}).showModal();

					return;
				}
				if(school.length<1){
					dialog({
						content: '请填写您的学校',
						okValue: '确认',
						ok: function () {
						},
					}).showModal();

					return;
				}
				$('#btn-num').css("background-image","url(__PUBLIC__/img/34/btn-1.png)");

//				$('#agreement').modal('show');
				var form = $("#tt");
				$.ajax({
					url: form.attr('action'),
					type: form.attr('method'),
					data: form.serialize(),
					dataType: 'json',
					success: function (data) {
						$("#btn-num-text").html("您的战队编号是：LOL"+data.info);
						$("#btn-num").hide();
						$('#agreement').modal('show');

					}
				})
				}

//					var id=$("#id").val();
////						$.post($("#tt").attr("action"),{"headername":headername,"idcard":idcard,"email":email,"telephone":telephone,"qqnumber":qqnumber,"school":school,"remarks":remarks,"corpsnumber":corpsnumber,"id":id},function(rst){
////							if(rst){
////								alert(rst);
////							}
////						})
//				var form = $("#tt");
//				$.ajax({
//					url: form.attr('action'),
//					type: form.attr('method'),
//					data: form.serialize(),
//					dataType: 'json',
//					success: function (data) {
//						alert("添加成功");
//						$("#btn-num").hide();
//					}
//				})
			function share () {
				var option = {
					title: 'LOL烽烟燃起！这是一场专属于大学生的战役！报名正式开始！', // 分享标题
					desc: '点燃英雄荣耀！英雄梦永不落幕！少年英雄，来！战个痛快！', // 分享描述
					link: "http://lol.xuanzhen-tech.com?channel={$_GET['channel']}", // 分享链接
					imgUrl: 'http://lol.xuanzhen-tech.com/Public/img/logo.png', // 分享图标
				};
				wx.onMenuShareTimeline(option);
				wx.onMenuShareAppMessage(option);
				wx.onMenuShareWeibo(option);
				wx.onMenuShareQQ(option);
				wx.onMenuShareQZone(option);
			}
			$(function(){
				wx.ready(share);
				var wxData = {$js};
				wx.config(wxData);
			})
		</script>
	</body>
</html>
